<template>
	<div class="app-container calendar-list-container">
		<div class="filter-container">
			<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="支付宝账户ID" v-model.trim="yyUserBindInfo.userId"> </el-input>
			<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="证件号码" v-model.trim="yyUserBindInfo.userCardNo"> </el-input>
			<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
			<el-button class="filter-item" v-if="yyUserBindInfoManager_btn_add" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="edit">添加</el-button>
		</div>
		<el-table :key='tableKey' :data="list" v-loading.body="listLoading" border fit highlight-current-row style="width: 100%">
			<el-table-column type="index" label="序号" header-align="center" align="center" width="65">
				<template scope="scope"><span>{{scope.$index+(yyUserBindInfo.page - 1) * yyUserBindInfo.limit + 1}} </span></template>
			</el-table-column>
			<el-table-column align="center" label="id" width="65" v-if="false">
				<template scope="scope">
					<span>{{scope.row.id}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="城市代码（名称）">
				<template scope="scope">
					<span>{{scope.row.cityCode}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="支付宝账户ID">
				<template scope="scope">
					<span>{{scope.row.userId}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="发卡机构代码（名称）">
				<template scope="scope">
					<span>{{scope.row.insCode}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="医疗证号">
				<template scope="scope">
					<span>{{scope.row.medicalCardId}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="外部医保卡号">
				<template scope="scope">
					<span>{{scope.row.medicalCardNo}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="证件类型">
				<template scope="scope">
					<span>{{scope.row.userCardType}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="证件号码">
				<template scope="scope">
					<span>{{scope.row.userCardNo}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="用户实名">
				<template scope="scope">
					<span>{{scope.row.realName}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="手机号">
				<template scope="scope">
					<span>{{scope.row.mobile}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="银行卡">
				<template scope="scope">
					<span>{{scope.row.bankCardNo}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="社保卡号">
				<template scope="scope">
					<span>{{scope.row.socialCardNo}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="扩展参数">
				<template scope="scope">
					<span>{{scope.row.extendParams}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="签约状态">
				<template scope="scope">
					<span>{{scope.row.signStatus}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="签约时间">
				<template scope="scope">
					<span>{{scope.row.gmtTime}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="外部卡状态">
				<template scope="scope">
					<span>{{scope.row.medicalCardStatus}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="卡类型">
				<template scope="scope">
					<span>{{scope.row.medicalCardType}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="外保卡有效期">
				<template scope="scope">
					<span>{{scope.row.medicalCardValidateDate}}</span>
				</template>
			</el-table-column>
			<el-table-column width="200px" align="center" label="城市行政区编码">
				<template scope="scope">
					<span>{{scope.row.cityNo}}</span>
				</template>
			</el-table-column>
			<el-table-column fixed="right" align="center" label="操作" width="150">
				<template scope="scope">
					<el-button v-if="yyUserBindInfoManager_btn_view" size="small" type="success" @click="checkedFn(scope.row)">查看
					</el-button>
					<el-button v-if="yyUserBindInfoManager_btn_edit" size="small" type="success" @click="handleUpdate(scope.row)">编辑
					</el-button>
					<el-button v-if="yyUserBindInfoManager_btn_del" size="small" type="danger" @click="handleDelete(scope.row)">删除
					</el-button>
				</template>
			</el-table-column>
		</el-table>
		<div v-show="!listLoading" class="pagination-container">
			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="yyUserBindInfo.page" :page-sizes="[10,20,30, 50]" :page-size="yyUserBindInfo.limit" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination>
		</div>
		<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
			<el-form :model="form" :rules="rules" ref="form" label-width="100px">
				<el-form-item label="城市代码" prop="cityCode">
					<el-input v-model="form.cityCode" placeholder="请输入城市代码"></el-input>
				</el-form-item>
				<el-form-item label="渠道代码" prop="channelCode">
					<el-input v-model="form.channelCode" placeholder="请输入渠道代码"></el-input>
				</el-form-item>
				<el-form-item label="支付宝账户ID" prop="userId">
					<el-input v-model="form.userId" placeholder="请输入支付宝账户ID"></el-input>
				</el-form-item>
				<el-form-item label="发卡机构代码" prop="insCode">
					<el-input v-model="form.insCode" placeholder="请输入发卡机构代码"></el-input>
				</el-form-item>
				<el-form-item label="医疗证号" prop="medicalCardId">
					<el-input v-model="form.medicalCardId" placeholder="请输入医疗证号"></el-input>
				</el-form-item>
				<el-form-item label="外部医保卡号" prop="medicalCardNo">
					<el-input v-model="form.medicalCardNo" placeholder="请输入外部医保卡号"></el-input>
				</el-form-item>
				<el-form-item label="证件类型" prop="userCardType">
					<el-input v-model="form.userCardType" placeholder="请输入证件类型"></el-input>
				</el-form-item>
				<el-form-item label="证件号码" prop="userCardNo">
					<el-input v-model="form.userCardNo" placeholder="请输入证件号码"></el-input>
				</el-form-item>
				<el-form-item label="用户实名" prop="realName">
					<el-input v-model="form.realName" placeholder="请输入用户实名"></el-input>
				</el-form-item>
				<el-form-item label="手机号" prop="mobile">
					<el-input v-model="form.mobile" placeholder="请输入手机号"></el-input>
				</el-form-item>
				<el-form-item label="签约协议号" prop="agreementNo">
					<el-input v-model="form.agreementNo" placeholder="请输入签约协议号"></el-input>
				</el-form-item>
				<el-form-item label="签约最终状态" prop="signStatus">
					<el-input v-model="form.signStatus" placeholder="请输入签约最终状态,成功绑定ACTIVED;成功解绑：DELETE；绑定中：BINDING；解绑中：DELETING"></el-input>
				</el-form-item>
				<el-form-item label="状态最后更新时间" prop="gmtTime">
					<el-input v-model="form.gmtTime" placeholder="请输入状态最后更新时间"></el-input>
				</el-form-item>
				<el-form-item label="用户证件照片" prop="userCertifyPic">
					<el-input v-model="form.userCertifyPic" placeholder="请输入用户证件照片"></el-input>
				</el-form-item>
				<el-form-item label="银行卡" prop="bankCardNo">
					<el-input v-model="form.bankCardNo" placeholder="请输入银行卡"></el-input>
				</el-form-item>
				<el-form-item label="外部登陆账户" prop="outUserAccount">
					<el-input v-model="form.outUserAccount" placeholder="请输入外部登陆账户"></el-input>
				</el-form-item>
				<el-form-item label="外部登陆账户ID" prop="outUserId">
					<el-input v-model="form.outUserId" placeholder="请输入外部登陆账户ID"></el-input>
				</el-form-item>
				<el-form-item label="社保卡号" prop="socialCardNo">
					<el-input v-model="form.socialCardNo" placeholder="请输入社保卡号"></el-input>
				</el-form-item>
				<el-form-item label="外保卡有效期" prop="medicalCardValidateDate">
					<el-input v-model="form.medicalCardValidateDate" placeholder="请输入外保卡有效期"></el-input>
				</el-form-item>
				<el-form-item label="外部卡状态 有效" prop="medicalCardStatus">
					<el-input v-model="form.medicalCardStatus" placeholder="请输入外部卡状态 有效：active;办理中：process;注销：cancel;挂失：loss"></el-input>
				</el-form-item>
				<el-form-item label="查询次数" prop="queryTimes">
					<el-input v-model="form.queryTimes" placeholder="请输入查询次数"></el-input>
				</el-form-item>
				<el-form-item label="回流次数" prop="uploadTimes">
					<el-input v-model="form.uploadTimes" placeholder="请输入回流次数"></el-input>
				</el-form-item>
				<el-form-item label="营销活动代码" prop="marketingCode">
					<el-input v-model="form.marketingCode" placeholder="请输入营销活动代码"></el-input>
				</el-form-item>
				<el-form-item label="绑卡详情页营销活动显示剩余次数" prop="marketingDisplayTimes">
					<el-input v-model="form.marketingDisplayTimes" placeholder="请输入绑卡详情页营销活动显示剩余次数"></el-input>
				</el-form-item>
				<el-form-item label="活动连接显示显示计数器" prop="marketingDisplayRest">
					<el-input v-model="form.marketingDisplayRest" placeholder="请输入活动连接显示显示计数器"></el-input>
				</el-form-item>
				<el-form-item label="卡包卡号" prop="cardNo">
					<el-input v-model="form.cardNo" placeholder="请输入卡包卡号"></el-input>
				</el-form-item>
				<el-form-item label="卡状态" prop="cardState">
					<el-input v-model="form.cardState" placeholder="请输入卡状态.ACTIVED:已开卡;DELETE:已删卡;ACTIVED_F:开卡失败;DELETE_F:删卡失败;"></el-input>
				</el-form-item>
				<el-form-item label="卡类型" prop="medicalCardType">
					<el-input v-model="form.medicalCardType" placeholder="请输入卡类型.金融卡:finance;非金融卡: unfinance"></el-input>
				</el-form-item>
				<el-form-item label="flg1" prop="flg1">
					<el-input v-model="form.flg1" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="flg2" prop="flg2">
					<el-input v-model="form.flg2" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="flg3" prop="flg3">
					<el-input v-model="form.flg3" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="flg4" prop="flg4">
					<el-input v-model="form.flg4" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="flg5" prop="flg5">
					<el-input v-model="form.flg5" placeholder="请输入"></el-input>
				</el-form-item>
				<el-form-item label="用户照片url" prop="userPhotoUrl">
					<el-input v-model="form.userPhotoUrl" placeholder="请输入用户照片url"></el-input>
				</el-form-item>
				<el-form-item label="监护关系" prop="relationType">
					<el-input v-model="form.relationType" placeholder="请输入监护关系:默认为空，本人;01父子;02母子;03其他;"></el-input>
				</el-form-item>
				<el-form-item label="最后更新时间" prop="gmtModified">
					<el-input v-model="form.gmtModified" placeholder="请输入最后更新时间"></el-input>
				</el-form-item>
				<el-form-item label="来源标识" prop="chinfo">
					<el-input v-model="form.chinfo" placeholder="请输入来源标识"></el-input>
				</el-form-item>
				<el-form-item label="社保查询数据采集最新时间" prop="siCollectionTime">
					<el-input v-model="form.siCollectionTime" placeholder="请输入社保查询数据采集最新时间"></el-input>
				</el-form-item>
				<el-form-item label="社保查询数据状态" prop="siCollectionStatus">
					<el-input v-model="form.siCollectionStatus" placeholder="请输入社保查询数据状态：空或者0正常，1采集中"></el-input>
				</el-form-item>
				<el-form-item label="签发等级" prop="signLevel">
					<el-input v-model="form.signLevel" placeholder="请输入签发等级：1:1级权限；2：2级权限"></el-input>
				</el-form-item>
				<el-form-item label="城市行政区编码" prop="cityNo">
					<el-input v-model="form.cityNo" placeholder="请输入城市行政区编码"></el-input>
				</el-form-item>
				<el-form-item label="扩展参数" prop="extendParams">
					<el-input v-model="form.extendParams" placeholder="请输入扩展参数"></el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="cancel('form')">取 消</el-button>
				<el-button v-if="dialogStatus=='create'" type="primary" @click="create('form')">确 定</el-button>
				<el-button v-else type="primary" @click="update('form')">确 定</el-button>
			</div>
		</el-dialog>
		<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisibleView">
			<el-form :model="form" :rules="rules" ref="form" label-width="100px">
				<el-form-item label="城市代码" prop="cityCode">
					<el-input v-model="form.cityCode" readonly></el-input>
				</el-form-item>
				<el-form-item label="渠道代码" prop="channelCode">
					<el-input v-model="form.channelCode" readonly></el-input>
				</el-form-item>
				<el-form-item label="支付宝账户ID" prop="userId">
					<el-input v-model="form.userId" readonly></el-input>
				</el-form-item>
				<el-form-item label="发卡机构代码" prop="insCode">
					<el-input v-model="form.insCode" readonly></el-input>
				</el-form-item>
				<el-form-item label="医疗证号" prop="medicalCardId">
					<el-input v-model="form.medicalCardId" readonly></el-input>
				</el-form-item>
				<el-form-item label="外部医保卡号" prop="medicalCardNo">
					<el-input v-model="form.medicalCardNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="证件类型" prop="userCardType">
					<el-input v-model="form.userCardType" readonly></el-input>
				</el-form-item>
				<el-form-item label="证件号码" prop="userCardNo">
					<el-input v-model="form.userCardNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="用户实名" prop="realName">
					<el-input v-model="form.realName" readonly></el-input>
				</el-form-item>
				<el-form-item label="手机号" prop="mobile">
					<el-input v-model="form.mobile" readonly></el-input>
				</el-form-item>
				<el-form-item label="签约协议号" prop="agreementNo">
					<el-input v-model="form.agreementNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="签约最终状态" prop="signStatus">
					<el-input v-model="form.signStatus" readonly></el-input>
				</el-form-item>
				<el-form-item label="状态最后更新时间" prop="gmtTime">
					<el-input v-model="form.gmtTime" readonly></el-input>
				</el-form-item>
				<el-form-item label="用户证件照片" prop="userCertifyPic">
					<el-input v-model="form.userCertifyPic" readonly></el-input>
				</el-form-item>
				<el-form-item label="银行卡" prop="bankCardNo">
					<el-input v-model="form.bankCardNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="外部登陆账户" prop="outUserAccount">
					<el-input v-model="form.outUserAccount" readonly></el-input>
				</el-form-item>
				<el-form-item label="外部登陆账户ID" prop="outUserId">
					<el-input v-model="form.outUserId" readonly></el-input>
				</el-form-item>
				<el-form-item label="社保卡号" prop="socialCardNo">
					<el-input v-model="form.socialCardNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="外保卡有效期" prop="medicalCardValidateDate">
					<el-input v-model="form.medicalCardValidateDate" readonly></el-input>
				</el-form-item>
				<el-form-item label="外部卡状态 有效" prop="medicalCardStatus">
					<el-input v-model="form.medicalCardStatus" readonly></el-input>
				</el-form-item>
				<el-form-item label="查询次数" prop="queryTimes">
					<el-input v-model="form.queryTimes" readonly></el-input>
				</el-form-item>
				<el-form-item label="回流次数" prop="uploadTimes">
					<el-input v-model="form.uploadTimes" readonly></el-input>
				</el-form-item>
				<el-form-item label="营销活动代码" prop="marketingCode">
					<el-input v-model="form.marketingCode" readonly></el-input>
				</el-form-item>
				<el-form-item label="绑卡详情页营销活动显示剩余次数" prop="marketingDisplayTimes">
					<el-input v-model="form.marketingDisplayTimes" readonly></el-input>
				</el-form-item>
				<el-form-item label="活动连接显示显示计数器" prop="marketingDisplayRest">
					<el-input v-model="form.marketingDisplayRest" readonly></el-input>
				</el-form-item>
				<el-form-item label="卡包卡号" prop="cardNo">
					<el-input v-model="form.cardNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="卡状态" prop="cardState">
					<el-input v-model="form.cardState" readonly></el-input>
				</el-form-item>
				<el-form-item label="卡类型" prop="medicalCardType">
					<el-input v-model="form.medicalCardType" readonly></el-input>
				</el-form-item>
				<el-form-item label="flg1" prop="flg1">
					<el-input v-model="form.flg1" readonly></el-input>
				</el-form-item>
				<el-form-item label="flg2" prop="flg2">
					<el-input v-model="form.flg2" readonly></el-input>
				</el-form-item>
				<el-form-item label="flg3" prop="flg3">
					<el-input v-model="form.flg3" readonly></el-input>
				</el-form-item>
				<el-form-item label="flg4" prop="flg4">
					<el-input v-model="form.flg4" readonly></el-input>
				</el-form-item>
				<el-form-item label="flg5" prop="flg5">
					<el-input v-model="form.flg5" readonly></el-input>
				</el-form-item>
				<el-form-item label="用户照片url" prop="userPhotoUrl">
					<el-input v-model="form.userPhotoUrl" readonly></el-input>
				</el-form-item>
				<el-form-item label="监护关系" prop="relationType">
					<el-input v-model="form.relationType" readonly></el-input>
				</el-form-item>
				<el-form-item label="最后更新时间" prop="gmtModified">
					<el-input v-model="form.gmtModified" readonly></el-input>
				</el-form-item>
				<el-form-item label="来源标识" prop="chinfo">
					<el-input v-model="form.chinfo" readonly></el-input>
				</el-form-item>
				<el-form-item label="社保查询数据采集最新时间" prop="siCollectionTime">
					<el-input v-model="form.siCollectionTime" readonly></el-input>
				</el-form-item>
				<el-form-item label="社保查询数据状态" prop="siCollectionStatus">
					<el-input v-model="form.siCollectionStatus" readonly></el-input>
				</el-form-item>
				<el-form-item label="签发等级" prop="signLevel">
					<el-input v-model="form.signLevel" readonly></el-input>
				</el-form-item>
				<el-form-item label="城市行政区编码" prop="cityNo">
					<el-input v-model="form.cityNo" readonly></el-input>
				</el-form-item>
				<el-form-item label="扩展参数" prop="extendParams">
					<el-input v-model="form.extendParams" readonly></el-input>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="cancel('form')">取 消</el-button>
				<el-button type="primary" @click="cancel('form')">确 定</el-button>
			</div>
		</el-dialog>
	</div>
</template>

<script>
	import {
		page,
		addObj,
		getObj,
		delObj,
		putObj
	} from 'api/admin/yyUserBindInfo/index';
	import { mapGetters } from 'vuex';
	export default {
		name: 'yyUserBindInfo',
		data() {
			return {
				form: {
					cityCode: undefined,
					channelCode: undefined,
					userId: undefined,
					insCode: undefined,
					medicalCardId: undefined,
					medicalCardNo: undefined,
					userCardType: undefined,
					userCardNo: undefined,
					realName: undefined,
					mobile: undefined,
					agreementNo: undefined,
					signStatus: undefined,
					gmtTime: undefined,
					userCertifyPic: undefined,
					bankCardNo: undefined,
					outUserAccount: undefined,
					outUserId: undefined,
					socialCardNo: undefined,
					medicalCardValidateDate: undefined,
					medicalCardStatus: undefined,
					queryTimes: undefined,
					uploadTimes: undefined,
					marketingCode: undefined,
					marketingDisplayTimes: undefined,
					marketingDisplayRest: undefined,
					cardNo: undefined,
					cardState: undefined,
					medicalCardType: undefined,
					flg1: undefined,
					flg2: undefined,
					flg3: undefined,
					flg4: undefined,
					flg5: undefined,
					userPhotoUrl: undefined,
					relationType: undefined,
					gmtModified: undefined,
					chinfo: undefined,
					siCollectionTime: undefined,
					siCollectionStatus: undefined,
					signLevel: undefined,
					cityNo: undefined,
					extendParams: undefined
				},
				rules: {
					/*  cityCode: [
  {
    required: true,
    message: '请输入城市代码',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   channelCode: [
  {
    required: true,
    message: '请输入渠道代码',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   userId: [
  {
    required: true,
    message: '请输入支付宝账户ID',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   insCode: [
  {
    required: true,
    message: '请输入发卡机构代码',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   medicalCardId: [
  {
    required: true,
    message: '请输入医疗证号',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   medicalCardNo: [
  {
    required: true,
    message: '请输入外部医保卡号',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   userCardType: [
  {
    required: true,
    message: '请输入证件类型',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   userCardNo: [
  {
    required: true,
    message: '请输入证件号码',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   realName: [
  {
    required: true,
    message: '请输入用户实名',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   mobile: [
  {
    required: true,
    message: '请输入手机号',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   agreementNo: [
  {
    required: true,
    message: '请输入签约协议号',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   signStatus: [
  {
    required: true,
    message: '请输入签约最终状态,成功绑定???ACTIVED;成功解绑：DELETE；绑定中：BINDING；解绑中：DELETING',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   gmtTime: [
  {
    required: true,
    message: '请输入状态最后更新时间',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   userCertifyPic: [
  {
    required: true,
    message: '请输入用户证件照片',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   bankCardNo: [
  {
    required: true,
    message: '请输入银行卡????',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   outUserAccount: [
  {
    required: true,
    message: '请输入外部登陆账户',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   outUserId: [
  {
    required: true,
    message: '请输入外部登陆账户ID',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   socialCardNo: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   medicalCardValidateDate: [
  {
    required: true,
    message: '请输入外?????保卡有效期',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   medicalCardStatus: [
  {
    required: true,
    message: '请输入外部卡状态 有效：active;办理中：process;注销：cancel;挂失：loss',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   queryTimes: [
  {
    required: true,
    message: '请输入查询次数',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   uploadTimes: [
  {
    required: true,
    message: '请输入回流次数',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   marketingCode: [
  {
    required: true,
    message: '请输入营销活动代码',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   marketingDisplayTimes: [
  {
    required: true,
    message: '请输入绑卡详情页营销活动显示剩余次数',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   marketingDisplayRest: [
  {
    required: true,
    message: '请输入活动连接显示显示计数器',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   cardNo: [
  {
    required: true,
    message: '请输入卡包卡号',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   cardState: [
  {
    required: true,
    message: '请输入卡?????状态.ACTIVED:已开卡;DELETE:已删卡;ACTIVED_F:开卡失败;DELETE_F:删卡失败;',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   medicalCardType: [
  {
    required: true,
    message: '请输入卡类型.金融卡:finance;非金融卡: unfinance',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   flg1: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   flg2: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   flg3: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   flg4: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   flg5: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   userPhotoUrl: [
  {
    required: true,
    message: '请输入用户照片url',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   relationType: [
  {
    required: true,
    message: '请输入监护关系:默认为空，本人;01父子;02母子;03其他;',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   gmtModified: [
  {
    required: true,
    message: '请输入最后更新时间',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   chinfo: [
  {
    required: true,
    message: '请输入来源标识',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   siCollectionTime: [
  {
    required: true,
    message: '请输入社保查询数据采集最新时间',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   siCollectionStatus: [
  {
    required: true,
    message: '请输入社保查询数据状态：空或者0正常，1采集中',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   signLevel: [
  {
    required: true,
    message: '请输入签发等级：1:1级权限；2：2级权限',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   cityNo: [
  {
    required: true,
    message: '请输入城市行政区编码',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   extendParams: [
  {
    required: true,
    message: '请输入扩展参数',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
]     */
				},
				list: null,
				total: null,
				listLoading: true,
				isCheckAll: false,
				yyUserBindInfo: {
					page: 1,
					limit: 10
				},
				dialogFormVisible: false,
				dialogFormVisibleView: false,
				dialogStatus: '',
				yyUserBindInfoManager_btn_view: false,
				yyUserBindInfoManager_btn_edit: false,
				yyUserBindInfoManager_btn_del: false,
				yyUserBindInfoManager_btn_add: false,
				textMap: {
					update: '编辑',
					create: '创建',
					checked: '查看'
				},
				tableKey: 0
			}
		},
		created() {
			this.getList();
			this.yyUserBindInfoManager_btn_view = this.elements['yyUserBindInfoManager:view'];
			this.yyUserBindInfoManager_btn_edit = this.elements['yyUserBindInfoManager:btn_edit'];
			this.yyUserBindInfoManager_btn_del = this.elements['yyUserBindInfoManager:btn_del'];
			this.yyUserBindInfoManager_btn_add = this.elements['yyUserBindInfoManager:btn_add'];
		},
		computed: {
			...mapGetters([
				'elements'
			])
		},
		methods: {
			checkedFn(data) {
				this.dialogStatus = 'checked';
				this.dialogFormVisibleView = true;
				this.form = data
			},
			getList() {
				if(!this.isCheckAll) {
					this.listLoading = false;
				} else {
					this.listLoading = true;
					page(this.yyUserBindInfo)
						.then(response => {
							this.list = response.data.rows;
							this.total = response.data.total;
							this.listLoading = false;
						})
				}
			},
			handleFilter() {
				if(!this.yyUserBindInfo.userId && !this.yyUserBindInfo.userCardNo) {
					this.$message({
						message: '请至少输入一项搜索条件！',
						duration: '2000',
						type: 'warning'
					})
					return false
				}
				this.isCheckAll = true;

				this.getList();
			},
			handleSizeChange(val) {
				this.yyUserBindInfo.limit = val;
				this.getList();
			},
			handleCurrentChange(val) {
				this.yyUserBindInfo.page = val;
				this.getList();
			},
			handleCreate() {
				this.resetTemp();
				this.dialogStatus = 'create';
				this.dialogFormVisible = true;
			},
			handleUpdate(row) {
				getObj(row.id)
					.then(response => {
						this.form = response.data;
						this.dialogFormVisible = true;
						this.dialogStatus = 'update';
					});
			},
			handleDelete(row) {
				this.$confirm('此操作将永久删除, 是否继续?', '提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					})
					.then(() => {
						delObj(row.id)
							.then(() => {
								this.$notify({
									title: '成功',
									message: '删除成功',
									type: 'success',
									duration: 2000
								});
								const index = this.list.indexOf(row);
								this.list.splice(index, 1);
							});
					});
			},
			create(formName) {
				const set = this.$refs;
				set[formName].validate(valid => {
					if(valid) {
						addObj(this.form)
							.then((result) => {
								if(result.status == 0) {
									this.dialogFormVisible = false;
									this.getList();
									this.$notify({
										title: '成功',
										message: result.message,
										type: 'success',
										duration: 2000
									});
								} else {
									this.$notify({
										title: '失败',
										message: result.message,
										type: 'warning',
										duration: 2000
									});
								}
							})
					} else {
						return false;
					}
				});
			},
			cancel(formName) {
				this.dialogFormVisible = false;
				this.dialogFormVisibleView = false;
				const set = this.$refs;
				set[formName].resetFields();
			},
			update(formName) {
				const set = this.$refs;
				set[formName].validate(valid => {
					if(valid) {
						//						this.dialogFormVisible = false;
						this.form.password = undefined;
						putObj(this.form.id, this.form).then((result) => {
							if(result.status == 0) {
								this.dialogFormVisible = false;
								this.getList();
								this.$notify({
									title: '成功',
									message: result.message,
									type: 'success',
									duration: 2000
								});
							} else {
								this.$notify({
									title: '失败',
									message: result.message,
									type: 'warning',
									duration: 2000
								});
							}
						});
					} else {
						return false;
					}
				});
			},
			resetTemp() {
				this.form = {
					username: undefined,
					name: undefined,
					sex: '男',
					password: undefined,
					description: undefined
				};
			}
		}
	}
</script>